package com.example.demo.filter;

import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class SensitiveWordFilter {
    private static final Set<String> bannedWords = Set.of("广告", "违规", "非法");

    public String filter(String content) {
        for (String word : bannedWords) {
            content = content.replaceAll(word, "***");
        }
        return content;
    }
}